home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / com / computer / casio_st / prog_fx / oisac2 / l_5570.txt < prev    next >
Text File  |  1994-03-01  |  2KB  |  42 lines

  1. 5 ONERRORGOTO500
  2. 10 MODE8:DIM:ERASEa,b,c$:DIMa(4),b(7),c$(7):a$="a b r x1y1":c$=CHR$(5)
  3. 20 CLS:PRINT"(x-a)ý+(y-b)ý=rý,(x1,y1)";
  4. 30 FORi=0 TO4
  5. 40 LOCATE0,1:PRINTc$;MID$(a$,i*2+1,(SGN(i-2.5)+1)/2+1);"=";a(i);"?";:INPUT@42;a(i):LOCATE0,0
  6. 50 IFi=2 ANDa(2)=<0 THEN40
  7. 60 IFi>2 THENIFABS(a(i-3)-a(i))/ABS(a(2))>1e5 THEN30
  8. 70 NEXT:a=a(0):b=a(1):r=a(2):x=a(3):y=a(4):LOCATE0,1:PRINTc$;".....";
  9. 75 IF(x-a)^2+(y-b)^2<r^2 THENGOTO300
  10. 80 IFx=a THEN100 ELSEc=(y-b)/(a-x):d=r^2/(a-x):e=c^2+1:f=c*(c*b+d)+b:g=(c*b+d)^2+b^2-r^2:l=f^2-e*g
  11. 90 IFl<0 THEN100 ELSEi=(f+SQRl)/e:k=(f-SQRl)/e:h=c*(i-b)-d+a:j=c*(k-b)-d+a:GOTO200
  12. 100 IFy=b THEN300 ELSEc=(x-a)/(b-y):d=r^2/(b-y):e=c^2+1:f=c*(c*a+d)+a:g=(c*a+d)^2+a^2-r^2:l=f^2-e*g
  13. 110 IFl<0 THEN300 ELSEh=(f+SQRl)/e:j=(f-SQRl)/e:i=c*(h-a)-d+b:k=c*(j-a)-d+b
  14. 200 IFABS(h-j)+ABS(i-k)<>0 THEN210
  15. 201 p$="(x1,y1)=(x2,y2)=(x3,y3),":n=0:c$(0)="d"
  16. 202 IFb=y THENp$=p$+"x=d":b(0)=x:GOTO400
  17. 203 IFx=a THENp$=p$+"y=d":b(0)=y:GOTO400
  18. 204 n=1:c$(0)="c":c$(1)="d":p$=p$+"y=cx+d":b(0)=(x-a)/(b-y):b(1)=y-(x-a)/(b-y)*x:GOTO400
  19. 210 p$="(x2,y2),":n=2:c$(0)="x2":c$(1)="y2":c$(2)="d"
  20. 220 b(0)=h:b(1)=i
  21. 230 IFx=h THENp$=p$+"x=d   ":b(2)=x:GOTO250
  22. 232 IFy=i THENp$=p$+"y=d   ":b(2)=y:GOTO250
  23. 234 n=3:p$=p$+"y=cx+d":c$(2)="c":c$(3)="d":b(2)=(i-y)/(h-x):b(3)=(y-i)/(h-x)*x+y
  24. 250 p$=p$+" : (x3,y3),"
  25. 260 n=n+1:c$(n)="x3":b(n)=j
  26. 270 n=n+1:c$(n)="y3":b(n)=k
  27. 275 n=n+1:c$(n)="f"
  28. 280 IFx=j THENp$=p$+"x=f":b(n)=x:GOTO400
  29. 282 IFy=k THENp$=p$+"y=f":b(n)=y:GOTO400
  30. 284 p$=p$+"y=ex+f":c$(n)="e":b(n)=(k-y)/(j-x):n=n+1:c$(n)="f":b(n)=(y-k)/(j-x)*x+y:GOTO400
  31. 300 LOCATE0,1:PRINTc$;"not found";:w$=INPUT$(1,@):GOTO20
  32. 400 CLS:PRINTp$;:PRINT:FORz=0 TOn
  33. 410 PRINTc$;c$(z);" =";b(z);
  34. 420 w=ASC(INPUT$(1,@)):IFw=13 THEN480
  35. 430 IFw=30 ANDz>0 THENz=z-2:GOTO480
  36. 440 IFw=31 ANDz<n THEN480
  37. 470 GOTO420
  38. 480 NEXT:GOTO20
  39. 500 IFERR=1 THENCLS:ONERRORGOTO0
  40. 510 IFERL=40 THENRESUME40
  41. 550 RESUME300
  42.